package com.chen.staffjoy.company.controller;

import com.chen.staffjoy.commonlib.base.BaseController;
import com.chen.staffjoy.company.entity.Job;
import com.chen.staffjoy.company.service.IJobService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 团队任务信息表 Controller
 *
 * @author ChenTian
 */ 
@RestController
@RequestMapping("/job")
public class JobController extends BaseController {

	@Resource
	private IJobService jobService;

	@GetMapping("/getById/{id}")
	public Job getById(@PathVariable String id) {
		Job result = jobService.findById(id);
		return result;
	}

	@DeleteMapping("/deleteById/{id}")
	public void deleteById(@PathVariable String id) {
		jobService.deleteById(id);
	}

	@PostMapping("/save")
	public Job save(@RequestBody Job model) {
		Job result = jobService.save(model);
		return result;
	}

}
